﻿// <summary>
// ----------------------------------------------------------------------------------------------------------------------
// 解决方案：Nuctech.ACCT.OIS.Common
// 项目：Nuctech.ACCT.OIS.Common
// 文件名称：
// ----------------------------------------------------------------------------------------------------------------------
// 功能描述：
// 创建者：zhangwentao
// 版本：
// 创建日期：2022-10-08 10:57
// ----------------------------------------------------------------------------------------------------------------------
// 修改者：zhangwentao
// 修改内容：
// 修改日期：2022-10-08 10:57
// ----------------------------------------------------------------------------------------------------------------------
// </summary>

namespace Nuctech.ACCT.OIS.Common
{
    public enum smErrorCode
    {
        // --------------------------------------------------------------------------------------
        // 	文 件 名: ErrorCode.cs
        // --------------------------------------------------------------------------------------
        // 	创建时间: 2019/10/29
        // 	版　　本: Version:  1.0.0
        // 	版    权: Copyright (C) 2007 - 2018 NUCTECH All Rights Reserved
        // 	作    者: 
        // --------------------------------------------------------------------------------------
        // 	说    明: 错误码定义。
        // --------------------------------------------------------------------------------------
        // 	修改历史:       
        // 			日期							改动
        //		2019.10.29							创建
        // --------------------------------------------------------------------------------------

        // sm_ec_Begin = 0x20008000,        /// 错误代码起始编码
        //========================================================================
        /// 通用错误码定义
        /// 范围:0x01 - 0x3F
        ///

        #region 错误码

        #region 内部错误码范围

        sm_ec_Begin = 0x2040000,    /// 错误代码起始编码

        dt_ec_Begin_Adapter                     = sm_ec_Begin + 0x1000,
        dt_ec_Begin_NetAccess                   = sm_ec_Begin + 0x2000,
        sh_ec_Begin_Router                      = sm_ec_Begin + 0x3000,
        sm_ec_Begin_Sms                         = sm_ec_Begin + 0x4000,
        sc_ec_Begin_Scs                         = sm_ec_Begin + 0x5000,
        rc_ec_Begin_Rcs                         = sm_ec_Begin + 0x6000,

        sm_ec_Success                           = 0,
        sm_ec_Failure                           = 1,

        #endregion

        #region 通用错误码定义  
        //范围:0x01 - 0x3F
        sm_ec_Failed = sm_ec_Begin + 0x01, /// 一般性失败,原因未知
        sm_ec_Timeout               = sm_ec_Begin + 0x02, /// 超时
        sm_ec_OutOfMemory           = sm_ec_Begin + 0x03, /// 内存不足
        sm_ec_NotActive             = sm_ec_Begin + 0x04, /// 对象未激活
        sm_ec_IoPending             = sm_ec_Begin + 0x05, /// IO等待中
        sm_ec_Overflow              = sm_ec_Begin + 0x06, /// 溢出
        sm_ec_OutOfSpace            = sm_ec_Begin + 0x40, /// 超出范围
        sm_ec_NotImplement          = sm_ec_Begin + 0x07, /// 未实现
        sm_ec_NotReady              = sm_ec_Begin + 0x08, /// 未准备好
        sm_ec_NoInterface           = sm_ec_Begin + 0x0A, /// 没有该接口
        sm_ec_NullPointer           = sm_ec_Begin + 0x0B, /// 空指针
        sm_ec_InvalidHandle         = sm_ec_Begin + 0x0C, /// 无效句柄
        sm_ec_InvalidCommand        = sm_ec_Begin + 0x0D, /// 无效命令
        sm_ec_InvalidData           = sm_ec_Begin + 0x0E, /// 数据无效
        sm_ec_InvalidArgs           = sm_ec_Begin + 0x0F, /// 参数无效
        sm_ec_InvalidOperation      = sm_ec_Begin + 0x10, /// 非法操作
        sm_ec_WaitingForInit        = sm_ec_Begin + 0x11, /// 等待初始化
        sm_ec_AlreadyExist          = sm_ec_Begin + 0x12, /// 已经存在
        sm_ec_NotFound              = sm_ec_Begin + 0x13, /// 没有找到
        sm_ec_Canceled              = sm_ec_Begin + 0x14, /// 取消操作
        sm_ec_OperateBroken         = sm_ec_Begin + 0x15, /// 操作中断
        sm_ec_DeadLock              = sm_ec_Begin + 0x16, /// 死锁
        sm_ec_Aborted               = sm_ec_Begin + 0x17, /// 终止
        sm_ec_Retry                 = sm_ec_Begin + 0x18, /// 重试
        sm_ec_Duplicate             = sm_ec_Begin + 0x19, /// 重复
        sm_ec_SystemError           = sm_ec_Begin + 0x1A, /// 系统错误
        sm_ec_NetworkError          = sm_ec_Begin + 0x1B, /// 网络错误
        sm_ec_LoadResourceFail      = sm_ec_Begin + 0x1C, /// 载入资源失败
        sm_ec_ModuleNotFound        = sm_ec_Begin + 0x1D, /// 模块未找到
        sm_ec_ServiceNotFound       = sm_ec_Begin + 0x1E, /// 服务未发现
        sm_ec_SizeTooLarge          = sm_ec_Begin + 0x1F, /// 太大
        sm_ec_SizeTooSmall          = sm_ec_Begin + 0x20, /// 太小
        sm_ec_BufferFull            = sm_ec_Begin + 0x21, /// 缓存满
        sm_ec_NoMoreData            = sm_ec_Begin + 0x22, /// 没有更多的数据
        sm_ec_ReadFileFaild         = sm_ec_Begin + 0x23, /// 读取文件失败
        sm_ec_FileCreateFaild       = sm_ec_Begin + 0x24, /// 文件创建失败
        sm_ec_DirCreateFaild        = sm_ec_Begin + 0x25, /// 目录创建失败
        sm_ec_FileNotExist          = sm_ec_Begin + 0x26, /// 文件不存在
        sm_ec_NotSupport            = sm_ec_Begin + 0x27, /// 不支持

        sm_ec_AlreadyActive			= sm_ec_Begin + 0x28, /// 已经激活，不能完成后续操作
        sm_ec_BufferLength			= sm_ec_Begin + 0x29, /// 缓存长度不正确
        sm_ec_InvalidStation		= sm_ec_Begin + 0x2A, /// 无效站点
        sm_ec_AlreadyConnected		= sm_ec_Begin + 0x2B, /// 已连接
        sm_ec_SerializeError		= sm_ec_Begin + 0x30, /// 序列化出错
        sm_ec_Busy					= sm_ec_Begin + 0x31, /// 忙碌
        sm_ec_VeryBusy				= sm_ec_Begin + 0x32, /// 非常忙碌
        sm_ec_ResourceUnavailable	= sm_ec_Begin + 0x33, /// 资源不可用
        sm_ec_NoSuchProcess			= sm_ec_Begin + 0x34, /// 没有这个进程
        sm_ec_AccessDenied			= sm_ec_Begin + 0x35, /// 访问拒绝
        sm_ec_InvalidUserOrPassword	= sm_ec_Begin + 0x36, /// 无效的用户名或密码
        sm_ec_UserNotLogon			= sm_ec_Begin + 0x37, /// 用户没有登录
        sm_ec_NotFoundStation		= sm_ec_Begin + 0x38, /// 没有找到站点
        sm_ec_NotFoundRequest		= sm_ec_Begin + 0x39, /// 没有找到请求点
        sm_ec_LogOutFailed			= sm_ec_Begin + 0x3A, /// 登出失败
        sm_ec_LogOnFailed			= sm_ec_Begin + 0x3B, /// 登录失败
        sm_ec_NotFoundSession		= sm_ec_Begin + 0x3C, /// 找不到会话
        sm_ec_InitialFailed			= sm_ec_Begin + 0x3D, /// 初始化失败
        sm_ec_LoadInterfaceFaild	= sm_ec_Begin + 0x3E, /// 加载接口函数失败
        sm_ec_Invalid_Cast			= sm_ec_Begin + 0x3F, /// 参数类型转换失败
        sm_ec_CommonFreightStation_Err = sm_ec_Begin + 0x40, /// 货站返回的货物信息异常
        #endregion

        #region Adapter

        dt_ec_NeedActive =           dt_ec_Begin_Adapter + 0x01, /// 需要激活	
        dt_ec_NeedBlock             =           dt_ec_Begin_Adapter + 0x02, /// 需要阻塞
        dt_ec_NeedSusspend          =           dt_ec_Begin_Adapter + 0x03,/// 需要挂起
        dt_ec_Exiting               =           dt_ec_Begin_Adapter + 0x04,/// 退出中
        dt_ec_StationManager        =           dt_ec_Begin_Adapter + 0x05,/// 站点管理器
        dt_ec_NotNeedSubscribe      =           dt_ec_Begin_Adapter + 0x06,/// 不需要订阅
        dt_ec_NeedDestory           =           dt_ec_Begin_Adapter + 0x07,/// 需要销毁
        dt_ec_WaitToDesroty         =           dt_ec_Begin_Adapter + 0x08,/// 等待被销毁
        dt_ec_AccessIsNullptr       =           dt_ec_Begin_Adapter + 0x09,/// 无效的访问器
        dt_ec_NotFoundStation       =           dt_ec_Begin_Adapter + 0x0A,/// 没有找到站点
        dt_ec_NotFoundSession       =           dt_ec_Begin_Adapter + 0x0B, /// 没有找到会话
        dt_ec_NotNeedCompress       =           dt_ec_Begin_Adapter + 0x0C,/// 不需要压缩
        dt_ec_UnCompressError       =           dt_ec_Begin_Adapter + 0x0D,/// 解压缩错误
        dt_ec_NoSendData            =           dt_ec_Begin_Adapter + 0x0E,/// 没有要发送的数据
        dt_ec_NotNeedSubscrib       =           dt_ec_Begin_Adapter + 0x0F,/// 没有要发送的数据
        dt_ec_Publishing            =           dt_ec_Begin_Adapter + 0x10, /// 发布数据中
        dt_ec_NoBroker              =           dt_ec_Begin_Adapter + 0x11,/// 缺少Broker
        dt_ec_AddFinish             =           dt_ec_Begin_Adapter + 0x12,/// 添加完成 

        #endregion

        #region NetAccess
        //dt_is_net_error T		    =	        ((T) > dt_ec_Begin_NetAccess && (T) <=dt_ec_MaxNetError) ? true: false,
        dt_ec_ConnectFaild =           dt_ec_Begin_NetAccess + 0x01,///连接失败
        dt_ec_NotConnected          =           dt_ec_Begin_NetAccess + 0x02,///未连接
        dt_ec_WaitAutoConnet        =           dt_ec_Begin_NetAccess + 0x03,///等待自动重连，此时还未连接成功
        dt_ec_RequestTimeOut        =           dt_ec_Begin_NetAccess + 0x04,///请求超时
        dt_ec_ConnectTimeOut        =           dt_ec_Begin_NetAccess + 0x05,///连接超时
        dt_ec_AdapterNotActive      =           dt_ec_Begin_NetAccess + 0x06, ///适配器未激活
        dt_ec_UseOneWay             =           dt_ec_Begin_NetAccess + 0x07, ///使用oneway
        dt_ec_UseTwoWay             =           dt_ec_Begin_NetAccess + 0x08, ///使用twoway
        dt_ec_FinishConnect         =           dt_ec_Begin_NetAccess + 0x09, ///关闭连接
        dt_ec_TransDamageed         =           dt_ec_Begin_NetAccess + 0x0A, ///传输器已损坏
        dt_ec_HeaderCheck           =           dt_ec_Begin_NetAccess + 0x0B, ///协议头部错误
        dt_ec_BadMagic              =           dt_ec_Begin_NetAccess + 0x0C, ///坏的magic
        dt_ec_UnacceptableProtocol  =           dt_ec_Begin_NetAccess + 0x0D, ///不接受的协议
        dt_ec_ObjectNotFind         =           dt_ec_Begin_NetAccess + 0x0E, ///对象为找到
        dt_ec_ObjectNameExist       =           dt_ec_Begin_NetAccess + 0x0F, ///对象已存在
        dt_ec_UnSupportedFunction   =           dt_ec_Begin_NetAccess + 0x10, ///不支持的功能
        dt_ec_UnSupportedInterface  =           dt_ec_Begin_NetAccess + 0x11,///不支持的接口
        dt_ec_ListenAddr            =           dt_ec_Begin_NetAccess + 0x12, ///监听地址打开错误
        dt_ec_ReuseContext          =           dt_ec_Begin_NetAccess + 0x13, ///重用context
        dt_ec_FreeContext           =           dt_ec_Begin_NetAccess + 0x14, ///回收context
        dt_ec_NoRequest             =           dt_ec_Begin_NetAccess + 0x15, ///缺少请求体
        dt_ec_NoResponse            =           dt_ec_Begin_NetAccess + 0x16, ///缺少响应体
        dt_ec_NoService             =           dt_ec_Begin_NetAccess + 0x17,///缺少网络服务
        dt_ec_PacketError           =           dt_ec_Begin_NetAccess + 0x18, ///包数据错误 
        dt_ec_MaxNetError			=           dt_ec_ListenAddr,

        #endregion
        
        #region 重建错误码定义
        /// 范围:
        rc_ec_SendQueueFull = rc_ec_Begin_Rcs + 0x01,  /// 发送队列满
        rc_ec_InitialFailed         = rc_ec_Begin_Rcs + 0x02,  /// 初始化失败
        rc_ec_NoPrn                 = rc_ec_Begin_Rcs + 0x03,  /// 没有Prn
        rc_ec_Reconstructing        = rc_ec_Begin_Rcs + 0x04, /// 重建中
        rc_ec_Calibrating           = rc_ec_Begin_Rcs + 0x05,    /// 校正中
        rc_ec_ReconReady            = rc_ec_Begin_Rcs + 0x06, /// 重建算法准备好
        rc_ec_ReconFailed           = rc_ec_Begin_Rcs + 0x07,    /// 重建算法失败
        rc_ec_InvalidOriData        = rc_ec_Begin_Rcs + 0x08, /// 无效的原始数据
        rc_ec_InvalidSliceData      = rc_ec_Begin_Rcs + 0x09,   /// 无效的切片数据
        rc_ec_HasAddedOriData       = rc_ec_Begin_Rcs + 0x0A,    /// 已添加的原始数据
        rc_ec_InvalidPackage        = rc_ec_Begin_Rcs + 0x0B, /// 无效的包
        rc_ec_InvalidEnergy         = rc_ec_Begin_Rcs + 0x0C,  /// 无效的能量类型
        rc_ec_NoPackageInfo         = rc_ec_Begin_Rcs + 0x0D,   /// 缺少包信息
        rc_ec_NoDetectorInfo        = rc_ec_Begin_Rcs + 0x0E,  /// 缺少探测器信息
        rc_ec_ImageProcessing       = rc_ec_Begin_Rcs + 0x0F, /// 图像处理中
        rc_ec_ReconstructFailed     = rc_ec_Begin_Rcs + 0x10,   /// 重建失败
        rc_ec_GraySynthesizeFailed  = rc_ec_Begin_Rcs + 0x11,    /// 材料识别失败
        rc_ec_RecgnisizeFailed      = rc_ec_Begin_Rcs + 0x12,    /// 嫌疑物识别失败
        rc_ec_CompressFailed        = rc_ec_Begin_Rcs + 0x13,  /// 压缩失败
        rc_ec_UnCompressFailed      = rc_ec_Begin_Rcs + 0x14,    /// 解压缩失败
        rc_ec_NoSliceData           = rc_ec_Begin_Rcs + 0x15, /// 缺少切片数据
        rc_ec_LastSliceData         = rc_ec_Begin_Rcs + 0x16,   /// 最后一层切片数据
        rc_ec_OpenHelFileFailed     = rc_ec_Begin_Rcs + 0x17,   /// 打开Hel文件失败
        rc_ec_WriteHelFileFailed    = rc_ec_Begin_Rcs + 0x18,  /// 写Hel文件失败
        rc_ec_ReadHelFileFailed     = rc_ec_Begin_Rcs + 0x19,   /// 读Hel文件失败
        rc_ec_WrongEnergySource     = rc_ec_Begin_Rcs + 0x1A,   /// 错误的能量源
        rc_ec_WrongOriData          = rc_ec_Begin_Rcs + 0x1B,    /// 错误的原始数据，当前扫描模式不应该有这样的数据，或者数据已添加结束。
        rc_ec_Recogning             = rc_ec_Begin_Rcs + 0x1C,   /// 识别中
        rc_ec_WaitHelixData         = rc_ec_Begin_Rcs + 0x1D,   /// 识别过程等待Helix数据
        rc_ec_InvalidDeviceType     = rc_ec_Begin_Rcs + 0x1E,   /// 无效的设备类型
        rc_ec_CalibReady            = rc_ec_Begin_Rcs + 0x1F,  /// 校正算法准备好	//-Added by gaoyang2.  2018/11/16 8:55:44  Detail: 
        rc_ec_CalibFailed           = rc_ec_Begin_Rcs + 0x20, /// 校正算法失败		//-Added by gaoyang2.  2018/11/16 8:55:50  Detail: 
        rc_ec_LackProjection        = rc_ec_Begin_Rcs + 0x21,  /// 加速器触发次数不足(漏触发)	//-Added by gaoyang2.  2018/12/08 17:04:28  Detail: 
        rc_ec_InvalidLength         = rc_ec_Begin_Rcs + 0x22,   /// 无效的长度
        rc_ec_OpenTspFileFailed     = rc_ec_Begin_Rcs + 0x23,   /// 打开Tsp文件失败
        rc_ec_WriteTspFileFailed    = rc_ec_Begin_Rcs + 0x24,  /// 写Tsp文件失败
        rc_ec_ReadTspFileFailed     = rc_ec_Begin_Rcs + 0x25,   /// 读Tsp文件失败
        rc_ec_InvalidCargoType      = rc_ec_Begin_Rcs + 0x26,    /// 无效的货箱类型
        rc_ec_InvalidDrData         = rc_ec_Begin_Rcs + 0x27,   /// 无效的DR数据
        rc_ec_ColorlizeFailed       = rc_ec_Begin_Rcs + 0x28, /// 彩色化数据失败

        rc_ec_Begin_ProcedureEngine = rc_ec_Begin_Rcs + 1000,
        rc_ec_InvalidDataType       = rc_ec_Begin_ProcedureEngine + 0x01,   /// 错误的数据类型
        rc_ec_InvalidDataID         = rc_ec_Begin_ProcedureEngine + 0x02,    /// 错误的数据ID
        rc_ec_NotComplete           = rc_ec_Begin_ProcedureEngine + 0x03, /// 流程没有完成
        rc_ec_ProcedureBroken       = rc_ec_Begin_ProcedureEngine + 0x04,   /// 流程中断

        #endregion
        
        /// 管理站错误码定义
        /// 范围:

        #region 数据库操作相关的错误码
        //////////////////////////////////////////////////////////////////////////
        ///
        sm_ec_DB_Begin = sm_ec_Begin_Sms + 0x100,    /// 数据库错误码

        sm_ec_DB_ConnectFailed = sm_ec_DB_Begin + 0x01, /// 连接失败
        sm_ec_DB_QueryFailed = sm_ec_DB_Begin + 0x02, /// 查询失败
        sm_ec_DB_ExecureFailed = sm_ec_DB_Begin + 0x03, /// 操作失败
        sm_ec_DB_CloseConnException = sm_ec_DB_Begin + 0x04, /// 关闭连接异常

        #endregion

        #region 验证相关的错误

        sm_ec_Crd_Begin = sm_ec_Begin_Sms + 0x200,             /// 验证相关错误码

        sm_ec_Crd_InvalidNameOrPSW           = sm_ec_Crd_Begin + 0x01,    /// 用户名或密码错误
        sm_ec_Crd_NoSuchUserName             = sm_ec_Crd_Begin + 0x02,    /// 不存在该用户名
        sm_ec_Crd_NullToken                  = sm_ec_Crd_Begin + 0x03,    /// token为空
        sm_ec_Crd_NoExistToken               = sm_ec_Crd_Begin + 0x04,    /// 缓存中token不存在
        sm_ec_Crd_TokenExpiration            = sm_ec_Crd_Begin + 0x05,    /// toekn已过期
        sm_ec_Crd_TokenNotBelongToCurrUser   = sm_ec_Crd_Begin + 0x06,    /// 当前用户不含此token
        sm_ec_Crd_QueryPrivilegeFailed       = sm_ec_Crd_Begin + 0x07,    /// 查询用户权限失败
        sm_ec_Crd_NoSuchPrivilege            = sm_ec_Crd_Begin + 0x08,    /// 没有此类权限
        sm_ec_Crd_AccessForbidden            = sm_ec_Crd_Begin + 0x09,    /// 禁止该权限访问
        sm_ec_Crd_NoLoginPrivilege           = sm_ec_Crd_Begin + 0x0A,    /// 没有登陆权限
        sm_ec_Automatic_LoginoutFailed       = sm_ec_Crd_Begin + 0x0B,    /// 自动注销失败
        sm_ec_Remove_TokenFailed             = sm_ec_Crd_Begin + 0x0C,    /// 移除token失败
        sm_ec_LogoutFailed                   = sm_ec_Crd_Begin + 0x0D,    /// 登出失败
        sm_ec_Crd_NoAuthLoginPrivilege       = sm_ec_Crd_Begin + 0x0E,    /// 没有授权该站点登录权限

        #endregion

        #region 查询相关的错误码

        sm_ec_Query_Begin = sm_ec_Begin_Sms + 0x300,         /// 查询相关错误码

        sm_ec_User_QueryFailed                          = sm_ec_Query_Begin + 0x01,    /// 未能查询用户信息
        sm_ec_Role_QueryFailed                          = sm_ec_Query_Begin + 0x02,    /// 未能查询角色信息
        sm_ec_User_Group_QueryFailed                    = sm_ec_Query_Begin + 0x03,    /// 未能查询用户组信息
        sm_ec_User_CheckPswErr                          = sm_ec_Query_Begin + 0x04,    /// 用户校验密码操作错误
        sm_ec_Priv_QueryFailed                          = sm_ec_Query_Begin + 0x05,    /// 未能查询权限信息
        sm_ec_Menus_QueryFailed                         = sm_ec_Query_Begin + 0x06,    /// 未能查询主菜单信息
        sm_ec_Menus_Users_QueryFailed                   = sm_ec_Query_Begin + 0x07,    /// 未能查询用户菜单信息
        sm_ec_Menus_Users_Group_QueryFailed             = sm_ec_Query_Begin + 0x08,    /// 未能查询用户组菜单信息
        sm_ec_Menus_Roles_QueryFailed                   = sm_ec_Query_Begin + 0x09,    /// 未能查询角色菜单信息
        sm_ec_Menus_Pictures_QueryFailed                = sm_ec_Query_Begin + 0x0A,    /// 未能查询图像菜单信息
        sm_ec_History_Pictures_QueryFailed              = sm_ec_Query_Begin + 0x0B,    /// 未能查询历史图像信息
        sm_ec_History_Pictures_Filtration_QueryFailed   = sm_ec_Query_Begin + 0x0C,    /// 未能查询历史图像过滤的条件信息
        sm_ec_Event_QueryFailed                         = sm_ec_Query_Begin + 0x0D,    /// 未能查询设备事件信息
        sm_ec_Event_Filtration_QueryFailed              = sm_ec_Query_Begin + 0x0E,    /// 未能查询设备事件过滤的条件信息
        sm_ec_Max_Prn_QueryFailed                       = sm_ec_Query_Begin + 0x0F,    /// 未能查询最大的流水号信息
        sm_ec_Diag_Report_QueryFailed                   = sm_ec_Query_Begin + 0x10,    /// 未能查询诊断报告
        sm_ec_User_In_UserGroup_QueryFailed             = sm_ec_Query_Begin + 0x11,    /// 未能查询到用户-用户组关系表中的数据
        sm_ec_User_In_Role_QueryFailed                  = sm_ec_Query_Begin + 0x12,    /// 未能查询到用户-角色关系表中的数据
        sm_ec_Scan_Num_QueryFailed                      = sm_ec_Query_Begin + 0x13,    /// 未能查询包裹数的数据
        sm_ec_Judement_Model_QueryFailed                = sm_ec_Query_Begin + 0x14,    /// 未能查询到判图模式数据
        sm_ec_SysJob_QueryFailed                        = sm_ec_Query_Begin + 0x15,    /// 未能查询系统任务信息
        sm_ec_SysJobExecRecord_QueryFailed              = sm_ec_Query_Begin + 0x16,    /// 未能查询系统任务执行记录信息
        sm_ec_Declare_QueryFailed                       = sm_ec_Query_Begin + 0x17,    /// 未能查询预检统计记录信息

        sm_ec_ImageTransfer_Name_Exist = sm_ec_Query_Begin + 0x24,    // 图像实时导出名称重复
        sm_ec_ImageTransfer_Url_Exist = sm_ec_Query_Begin + 0x25,     // 图像实时导出url重复

        #endregion

        #region 新建相关的错误码

        sm_ec_Create_Begin = sm_ec_Begin_Sms + 0x400,        /// 角色相关错误码

        sm_ec_User_CreateFailed             = sm_ec_Create_Begin + 0x01,    /// 创建用户失败
        sm_ec_Role_CreateFailed             = sm_ec_Create_Begin + 0x02,    /// 创建角色失败
        sm_ec_User_Group_CreateFailed       = sm_ec_Create_Begin + 0x03,    /// 创建用户组失败
        sm_ec_Event_CreateFailed            = sm_ec_Create_Begin + 0x04,    /// 创建设备事件失败
        sm_ec_Scan_Info_CreateFailed        = sm_ec_Create_Begin + 0x05,    /// 创建扫描信息表失败
        sm_ec_Diag_Report_CreateFailed      = sm_ec_Create_Begin + 0x06,    /// 创建诊断报告失败
        sm_ec_Judge_Info_CreateFailed       = sm_ec_Create_Begin + 0x07,    /// 创建判图信息失败
        sm_ec_Image_Num_CreateFailed         = sm_ec_Create_Begin + 0x08,    /// 创建扫描\判图嫌疑计数信息失败
        sm_ec_Diag_Info_CreateFailed        = sm_ec_Create_Begin + 0x09,    /// 创建诊断信息失败
        sm_ec_Job_CreateFailed              = sm_ec_Create_Begin + 0x0A,    /// 创建设备事件失败
        sm_ec_SysJob_CreateFailed           = sm_ec_Create_Begin + 0x0B,    /// 创建系统任务失败

        #endregion
        
        #region 更新相关的错误码
        
        sm_ec_Update_Begin = sm_ec_Begin_Sms + 0x500,        /// 更新相关错误码

        sm_ec_User_UpdateFailed             = sm_ec_Update_Begin + 0x01,    /// 更新用户失败
        sm_ec_Role_UpdateFailed             = sm_ec_Update_Begin + 0x02,    /// 更新角色失败
        sm_ec_User_Group_UpdateFailed       = sm_ec_Update_Begin + 0x03,    /// 更新用户组失败
        sm_ec_User_UpdatePswFailed          = sm_ec_Update_Begin + 0x04,    /// 更新密码失败
        sm_ec_Scan_Info_UpdateFailed        = sm_ec_Update_Begin + 0x05,    /// 更新扫描信息表失败
        sm_ec_Image_SaveFailed              = sm_ec_Update_Begin + 0x06,    /// 手动保存图像失败
        sm_ec_Image_LockFailed              = sm_ec_Update_Begin + 0x07,    /// 锁定图像失败
        sm_ec_Image_UnlockFailed            = sm_ec_Update_Begin + 0x08,    /// 解锁图像失败
        sm_ec_Update_Failed                 = sm_ec_Update_Begin + 0x09,    /// 执行更新操作但是未做任何修改
        sm_ec_Reset_Failed                  = sm_ec_Update_Begin + 0x0A,    /// 复位失败
        sm_ec_JudementModel_Failed          = sm_ec_Update_Begin + 0x0B,    /// 更新判图模式失败
        sm_ec_Job_UpdateFailed              = sm_ec_Update_Begin + 0x0C,    /// 创建设备事件失败
        sm_ec_SysJob_UpdateFailed           = sm_ec_Update_Begin + 0x0D,    /// 更新系统任务失败

        #endregion

        #region 删除相关的错误码
        
        sm_ec_Del_Begin = sm_ec_Begin_Sms + 0x600,           /// 删除相关错误码

        sm_ec_User_Pseudo_DeleteFailed                      = sm_ec_Del_Begin + 0x01,                   /// 伪删除用户失败
        sm_ec_Role_Pseudo_DeleteFailed                      = sm_ec_Del_Begin + 0x02,                   /// 伪删除角色失败
        sm_ec_User_Group_Pseudo_DeleteFailed                = sm_ec_Del_Begin + 0x03,                   /// 伪删除用户组失败
        sm_ec_History_Pictures_Pseudo_DeleteFailed          = sm_ec_Del_Begin + 0x04,                   /// 伪删除历史图像失败
        sm_ec_User_Group_Rel_Pseudo_DeleteFailed            = sm_ec_Del_Begin + 0x05,                   /// 伪删除用户--用户组关系表数据失败
        sm_ec_User_Role_Rel_Pseudo_DeleteFailed             = sm_ec_Del_Begin + 0x06,                   /// 伪删除用户--角色关系表数据失败

        sm_ec_User_Real_DeleteFailed                        = sm_ec_Del_Begin + 0x51,                   /// 删除用户失败
        sm_ec_Role_Real_DeleteFailed                        = sm_ec_Del_Begin + 0x52,                   /// 删除角色失败
        sm_ec_User_Group_Real_DeleteFailed                  = sm_ec_Del_Begin + 0x53,                   /// 删除用户组失败
        sm_ec_Event_Real_DeleteFailed                       = sm_ec_Del_Begin + 0x54,                   /// 删除事件表
        sm_ec_Job_DeleteFailed                              = sm_ec_Del_Begin + 0x55,                   /// 创建设备事件失败

        #endregion
        
        #region 数据传输相关的错误，比如API的JSON数据
        
        sm_ec_Data_Transfer_Begin = sm_ec_Begin_Sms + 0x700,                  /// 数据传输相关的错误

        sm_ec_Json_Format_Error             = sm_ec_Data_Transfer_Begin + 0x01,    /// Json格式错误
        //sm_ec_SCS_Begin_Diag_Error          = sm_ec_Data_Transfer_Begin + 0x02,    /// 开始诊断请求失败
        //sm_ec_SCS_Diag_Detector_Error       = sm_ec_Data_Transfer_Begin + 0x03,    /// 探测器诊断请求失败
        //sm_ec_SCS_Diag_Source_Error         = sm_ec_Data_Transfer_Begin + 0x04,    /// 加速器诊断请求失败
        sm_ec_Data_Format_Error             = sm_ec_Data_Transfer_Begin + 0x05,    /// 数据格式错误

        #endregion

        #region 广播各站点的错误码

        sm_ec_SCS_Request_Begin = sm_ec_Begin_Sms + 0x800,                  /// SCS请求

        sm_ec_DiagSceneRequest_Error            = sm_ec_SCS_Request_Begin + 0x01,    /// 诊断场景请求失败
        sm_ec_AutoDiagRequest_Error             = sm_ec_SCS_Request_Begin + 0x02,    /// 自动诊断请求失败
        sm_ec_DiagSourceRequest_Error           = sm_ec_SCS_Request_Begin + 0x03,    /// 加速器诊断请求失败
        sm_ec_DiagDetectorRequest_Error         = sm_ec_SCS_Request_Begin + 0x04,    /// 探测器诊断请求失败
        sm_ec_SaveRawOriDataRequest_Error       = sm_ec_SCS_Request_Begin + 0x05,    /// 探测器保存数据请求失败
        sm_ec_DiagVehicleRequest_Error          = sm_ec_SCS_Request_Begin + 0x06,    /// 轨道车请求失败
        sm_ec_ManualDeleteImageRequest_Error    = sm_ec_SCS_Request_Begin + 0x07,    /// 删除图片请求失败
        sm_ec_CountInfoRequest_Error            = sm_ec_SCS_Request_Begin + 0x08,    /// 计数器信息请求失败

        #endregion

        #region 扫描站错误码定义
        /// 范围:

        // 通用
        sc_ec_Begin_Scs_Common = sc_ec_Begin_Scs + 0x100,

        sc_ec_InitialFailed = sc_ec_Begin_Scs_Common + 0x01,  /// 初始化失败
        sc_ec_NoPrn = sc_ec_Begin_Scs_Common + 0x02,  /// 没有Prn
        sc_ec_CurScanModeError =	sc_ec_Begin_Scs_Common + 0x03,  /// 当前扫描模式错误

        sc_ec_ReportSuccess = sc_ec_Begin_Scs_Common + 0x91,/// 设备维护成功
        sc_ec_ReportFailed = sc_ec_Begin_Scs_Common + 0x92,/// 设备维护失败

        //扫描流程
        sc_ec_Begin_Scs_Scan = sc_ec_Begin_Scs + 0x200,

        sc_ec_SceneStatusError = sc_ec_Begin_Scs_Scan + 0x01, /// 场景状态错误
        sc_ec_ScanTypeError = sc_ec_Begin_Scs_Scan + 0x02, /// 扫描类型错误
        sc_ec_CurSceneNotDiag = sc_ec_Begin_Scs_Scan + 0x03, /// 当前场景不为diag
        sc_ec_CurSceneNotScan = sc_ec_Begin_Scs_Scan + 0x04, /// 当前场景不为scan
        sc_ec_CanNotChangeScene =   sc_ec_Begin_Scs_Scan + 0x05, /// 当前场景不能转换

        //PLC
        sc_ec_Begin_Scs_PLC = sc_ec_Begin_Scs + 0x300,

        sc_ec_PlcStationNetError = sc_ec_Begin_Scs_PLC + 0x01, /// Plc站点网络错误
        sc_ec_PlcStationError = sc_ec_Begin_Scs_PLC + 0x02, /// PLC站点错误
        sc_ec_PlcSceneError = sc_ec_Begin_Scs_PLC + 0x03, /// PLC场景错误 

        //探测器
        sc_ec_Begin_Scs_Detector = sc_ec_Begin_Scs + 0x400,

        sc_ec_SendQueueFull = sc_ec_Begin_Scs_Detector + 0x01, /// 发送队列满
        sc_ec_DetStationNetError = sc_ec_Begin_Scs_Detector + 0x02, /// Det站点网络错误
        sc_ec_DetStatusError = sc_ec_Begin_Scs_Detector + 0x03, /// Det状态错误
        sc_ec_ClctCmdError = sc_ec_Begin_Scs_Detector + 0x04, /// 采集命令错误
        sc_ec_ClctStatusError = sc_ec_Begin_Scs_Detector + 0x05, /// 采集状态错误 

        //数据库
        sc_ec_Begin_Scs_Rdb = sc_ec_Begin_Scs + 0x500,

        sc_ec_RdbNotConnected = sc_ec_Begin_Scs_Rdb + 0x01, /// 数据库为连接
        sc_ec_RdbConnecteFailed = sc_ec_Begin_Scs_Rdb + 0x02, /// 数据库连接失败
        sc_ec_SqlExcFailed = sc_ec_Begin_Scs_Rdb + 0x03, /// SQL执行失败
        sc_ec_SqlNullPrn = sc_ec_Begin_Scs_Rdb + 0x04, /// SQL查询Prn为空

        //诊断  //诊断模式下，有新请求时，如果此请求不能进行，发送此时正在运行流程的错误码
        sc_ec_Begin_Scs_Diag = sc_ec_Begin_Scs + 0x600,

        sc_ec_DiagVehicleRun = sc_ec_Begin_Scs_Diag + 0x01,   //轨道车运行
        sc_ec_DiagVehicleRorate = sc_ec_Begin_Scs_Diag + 0x02,   //轨道车旋转
        sc_ec_DiagVehicleRoller = sc_ec_Begin_Scs_Diag + 0x03,   //轨道车滚筒

        sc_ec_DiagSource = sc_ec_Begin_Scs_Diag + 0x04,   //加速器
        sc_ec_DiagDetClctBg = sc_ec_Begin_Scs_Diag + 0x05,   //探测器诊断采集本底

        sc_ec_DiagDetBeam = sc_ec_Begin_Scs_Diag + 0x06,   //探测器诊断出束
        sc_ec_DiagDetClctAir = sc_ec_Begin_Scs_Diag + 0x07,   //探测器诊断采集空气
        sc_ec_AutoDiag = sc_ec_Begin_Scs_Diag + 0x08,   //自动诊断

        sc_ec_BgCanNotBeam = sc_ec_Begin_Scs_Diag + 0x09,   // 探测器诊断本底时，不能出束

        #endregion

        #endregion
    }

    public class smErrorCodeUtilt
    {
        /// 是否为成功状态码。
        public static bool IsSuccess(smErrorCode ec)
        {
            return ec == smErrorCode.sm_ec_Success;
        }


    }

    public enum emSceneStage
    {
        emSceneStage_Unknown = 0x000,
        emSceneStage_Initialize_Waiting = 0x011,
        emSceneStage_Scan_Ready = 0x021,
        emSceneStage_Scan_Normal = 0x022,
        emSceneStage_Scan_Quick = 0x023,
        emSceneStage_Scan_Excp = 0x024,
        emSceneStage_Calib_Ready = 0x031,
        emSceneStage_Calib_Runing = 0x032,
        emSceneStage_Calib_Excp = 0x033,
        emSceneStage_Diag_Ready = 0x041,
        emSceneStage_Diag_Runing = 0x42,
        emSceneStage_Diag_Excp = 0x43,
        emSceneStage_Maint_Ready = 0x051,
        emSceneStage_Maint_Runing = 0x52,
        emSceneStage_Maint_Excp = 0x53,

        emSceneStage_Perform_Ready = 0x061,
        emSceneStage_Perform_Runing = 0x062,
        emSceneStage_Perform_Excp = 0x063,
        emSceneStage_Test = 0x081,
        emSceneStage_Exit = 0x082,
        emSceneStage_Excp = 0x083,
    };

}
